package com.uzai.console.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.profit.normalrewardrule.NormalRewardRuleQuery;
import com.uzai.console.entity.ConfigPlan;
import com.uzai.console.entity.NormalRewardRule;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface NormalRewardRuleMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(NormalRewardRule record);

    int insertSelective(NormalRewardRule record);

    NormalRewardRule selectById(@Param("id") Long id, @Param("merId") Long merId);

    NormalRewardRule selectByIsDefault(@Param("merId") Long merId);

    NormalRewardRule selectByNameAndMerId(@Param("name") String name, @Param("merId") Long merId);

    int updateSelective(NormalRewardRule record);

    int update(NormalRewardRule record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<NormalRewardRule> findByList(Page<NormalRewardRule> page, @Param("query") NormalRewardRuleQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<NormalRewardRule> findByList(@Param("query") NormalRewardRuleQuery query);
}